<!doctype html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<!-- 首页 -->
	<title alt="1"></title>
	<link rel="shortcut icon" href="__PUBLIC__/Home/Images/favicon.ico" type="image/x-icon" />
	<meta name="keywords" content="" />
     <meta name="description" content="" />
	<link rel="stylesheet" href="__PUBLIC__/Home/Css/header.css">
	<link rel="stylesheet" href="__PUBLIC__/Home/Css/home.css">
	<link rel="stylesheet" href="__PUBLIC__/Home/Css/footer.css">
	<script src="__PUBLIC__/Home/Js/jquery.js"></script>
</head>
<body>
	<!-- 载入头文件 -->
	<include file="Header/index" />

	<!-- 内容部分 -->
	<div id="main_content">
		<!-- 主页幻灯片 -->
		<div id="main_picSlide">
			<ul id="play_slide">
				<foreach name="slide" item="slide">
					<li style="display:none;">
						<a href="{$slide.links}">
							<img src="__PUBLIC__/Home/Images/slide/{$slide.address}">
						</a>
					</li>
				</foreach>
			</ul>
			<ul id="play_btn_box">
				<for start="0" end="6" step="1">
					<li></li>
				</for>
			</ul>
		</div>

		<!-- 清除浮动 -->
		<div class="clear"></div>

		<!-- 板块 -->
		<div class="main_plate">
			<!-- 女装 -->
			<foreach name="goods" item="cate">
			<div class="main_Board">
				<div class="Board_title">
					<span class="Board_title_left">
						<a href="__APP__/Home/Plate/index.html?id={$cate.pid}">{$cate.navName}</a>
					</span>

					<div>
						<a href="__APP__/Home/Plate/index.html?id={$cate.pid}"></a>
					</div>
				</div>
				<!-- 清除浮动 -->
				<span class="clear"></span>

				<!-- 板块左边部分 -->
				<div class="Board_left">
					<div class="img_plate">
						<ul class="nvzhuang_img">
							<foreach name="cate['menu']" item="menu">
								<li class="img_goods_focus" title="{$menu['goodsname']}">
									<a href="__APP__/Home/Detial/Detial/id/{$menu['id']}">
										<img class="img_goods_pic" src="__PUBLIC__/Home/Images/goods/{$menu['goodsimg']}">
										<div>
											<span class="img_goods_left">{$menu['goodsname']}</span>
											<span class="img_goods_right">￥<b>{$menu['promoteprice']}</b></span>
										</div>
									</a>
								</li>
							</foreach>
						</ul>
					</div>
				</div>
			</div>
			</foreach>
		</div>


		<!-- 首页遮罩广告 -->
		<div id="overlay">
			<div style="background:#000;filter:alpha(opacity=40);opacity:0.4;-moz-opacity:0.4;width:100%;height:100%; position:fixed; _position:absolute;left:0px;top:0px; z-index:999998;"></div>
			<div id="screenAdPop">
				<p>
					<a href="javascript:">
						<img id="img_top" style="border:none;vertical-align:top;">
					</a>
				</p>
				<span id="screenClose"></span>
			</div>
		</div>
	
		<a href="javascript:" onfocus="this.blur();">
			<img src="__PUBLIC__/Home/Images/bottombanner_1200_140219.jpg" style="margin-bottom:10px;">
		</a>
	</div>
	<!-- 载入脚文件 -->
	<include file="Public/footer" />
</body>
<script>
	//判断用户是否为登陆状态
	if({$state} == 0){
		$("#overlay").css("display","block");
		// alert(1);
	}else{
		$("#overlay").css("display","none");
		// alert(0);
	}
	// alert({$state});

	// 得到屏幕工作区域的宽高
	screenWidth =  document.documentElement.clientWidth;
	screenHeight = document.documentElement.clientHeight;

	var scr = document.getElementById("screenAdPop");
	var img = document.getElementById("img_top");

	$.get("__CONTROLLER__/getBanner",function(data){
		$("#img_top").attr("src","__PUBLIC__/Home/Images/slide/"+data['address']);
	},"json");

	// 幻灯片----------------------------------------------------
	var oli = $("#play_slide li");
	var bli = $("#play_btn_box li");
	var i = num = 0;

	for(i=0;i<oli.length;i++){
		bli[i].index = i;
		bli.eq(i).mouseover(function(){
			if(num != this.index){
				num = this.index;
				show(this.index);
				clearInterval(play);
			}
		});
	}

	show(num);

	oli.mouseover(function(){
		clearInterval(play);
	});
	oli.mouseout(function(){
		autoplay();
	});

	autoplay();
	function autoplay(){
		play = setInterval(function(){
			num++;
			num >= oli.length && ( num = 0 );
			show(num);
		},3000);
	}
	
	function show(a){
		for(i=0;i<oli.length;i++){
			oli.eq(i).css("display","none");
			bli.eq(i).css("background","#9E9D9D");
		}
		oli.eq(a).fadeIn(1000);
		bli.eq(a).css("background","#CC0000");
	}
// 幻灯片----------------------------------------------------------------------




	// 首页遮罩广告
	$("#screenClose").click(function(){
		close();
	});
	
	setInterval(function(){
		close();
	},5000);

	function close(){
		$("#overlay").fadeOut(500);
	}

	// 图片加载完成后再执行下面代码，否则获取不到宽高度
	img.onload = function(){
		scr.style.left = (parseInt(screenWidth,10) - img.offsetWidth) / 2 + 'px';
		scr.style.top = (parseInt(screenHeight,10) - img.offsetHeight) / 2 + 'px';
	}

	$(".img_goods_pic").hover(function(){
		$(this).animate({left: '-5px'}, 200);
		$(this).parent().parent().css({"border":"1px solid #a10000"});
	},function(){
		$(this).animate({left: '+0px'}, 200);
		$(this).parent().parent().css("border","1px solid #E8E8EA");
	});
</script>
</html>